import { server } from '../config';

export const addRole = data => {
    return server({
        method: 'post',
        url: '/role/addRole',
        data
    });
};


export const deleteRole = params => {
    return server({
        method: 'delete',
        url: `/role/deleteRole/${params.roleId}`
    });
};


export const getAllRoles = params => {
    return server({
        method: 'get',
        url: '/role/getAllRoles',
        params
    });
};


export const getRole = params => {
    return server({
        method: 'get',
        url: '/role/getRole',
        params
    });
};

export const getOnlyAllRoles = () => {
    return server({
        method: 'get',
        url: '/role/getOnlyAllRoles'

    });
};


export const updateRole = data => {
    return server({
        method: 'put',
        url: '/role/updateRole',
        data
    });
};






